//
// Created by wkm on 2023-12-11.
//

#ifndef MYSYSTEMCLEARNING_FULL_ADDER_DRIVER_H
#define MYSYSTEMCLEARNING_FULL_ADDER_DRIVER_H

#include <iostream>
#include <fstream>
#include "systemc.h"

SC_MODULE(driver) {
    sc_out<bool> d_a, d_b, d_cin;
    bool t_a, t_b, t_cin;
    ifstream infile;

    void driver_prc();

    SC_CTOR(driver) {
        SC_THREAD(driver_prc);
        infile.open("full_adder.in");
        if (!infile) {
            cerr << "ERROR: Unable to open vector file," << " fa_with_ha.in! \n";
            sc_stop();
        }
    }

    // 在析构函数中关闭文件
    ~driver() {
        infile.close();
    }
};

#endif //MYSYSTEMCLEARNING_FULL_ADDER_DRIVER_H
